package com.mycompany.webapp.action;

import java.util.HashMap;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsTestCase;

import com.mycompany.Constants;

public class StrutsMockTestCase extends StrutsTestCase {
	private final Log log = LogFactory.getLog(this.getClass());

	public StrutsMockTestCase(){				
		try {
			String config = PropertyResourceBundle.getBundle(Constants.TEST_PROPERTIES).getString(Constants.STRUTS_CONFIG);
			dispatcherInitParams = new HashMap<String, String>();		
			dispatcherInitParams.put(Constants.STRUTS_CONFIG, config);
		} 
		catch(MissingResourceException mre) {
			log.debug("Test.properties file, or config property, not found. This is required if struts.xml for tests " +
					"is not in default location (target/classes)");
		}
	}
}
